Skip to main content

Execute

Executes the command which will be used to create the document file (text document, spreadsheet, presentation, form document, PDF). See the Text document API, Spreadsheet API, Presentation API, or Form API sections for more information which commands are available for various document types.

Please note, that for the .docbuilder file the CDocBuilder.Execute method is not used explicitly. The command itself is used instead. See the example below.

Syntax

HRESULT Execute([in] BSTR command, [out, retval] I_DOCBUILDER_VALUE** result);

Parameters

NameTypeDescription
commandBSTRThe command which will be used to create the document file (the escape character must be used when the command contains quotation symbols).
resultI_DOCBUILDER_VALUE**The command return value.

Example

COM

CoInitialize(NULL);
IONLYOFFICEDocBuilder* oBuilder = NULL;
IONLYOFFICEDocBuilderValue* oRun = NULL;
oBuilder->Initialize();
oBuilder->Execute(L"oParagraph.AddText(\"Hello, world!\");", &oRun);
oBuilder->Dispose();

.docbuilder

oParagraph.AddText("Hello, world!")